package com.aznest.controller;

import com.aznest.result.Result;
import com.aznest.service.StatAllService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.Map;

@RestController
@RequestMapping("/statisticsAll")
@Api(tags = "管理员统计相关接口")
public class StatAllController {
    @Resource
    private StatAllService statAllService;

    /**
     * 统计基础数据
     * @return
     */
    @GetMapping("/base")
    @ApiOperation("统计基础数据")
    public Result base(){
        Map<String,Object> map = statAllService.base();
        return Result.success(map);

    }

    /**
     * 统计订单数前五的酒店
     * @return
     */
    @GetMapping("/loadHotelOrderNumTopFive")
    @ApiOperation("统计订单数前五的酒店")
    public Result loadHotelOrderNumTopFive() {
        Map<String, Object> map = statAllService.loadHotelOrderNumTopFive();
        return Result.success(map);
    }

    /**
     * 统计本月营业额前五的酒店
     * @return
     */
    @GetMapping("/loadHotelIncomeTopFive")
    @ApiOperation("统计本月营业额前五的酒店")
    public Result loadHotelIncomeTopFive(){
        Map<String,Object> map = statAllService.loadHotelIncomeTopFive();
        return Result.success(map);
    }
}
